<template>
  <a-drawer
    width="576"
    :title="formTitle"
    :label-col="4"
    :wrapper-col="14"
    :visible="open"
    :body-style="{height:'calc(100vh - 100px)',overflow:'auto'}"
    @close="cancel">
    <a-form-model ref="form" :model="form" :rules="rules" layout="vertical">
      <a-spin :spinning="spinning" :delay="delayTime" tip="Loading...">
        <a-row :gutter="32">
          <a-col :span="24">
            <a-form-model-item label="类目编码" prop="categoryCode">
              <a-textarea v-model="form.categoryCode" placeholder="请输入类目编码" :rows="4"/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="32">
          <a-col :span="24">
            <a-form-model-item label="类目名称" prop="categoryName">
              <a-input v-model="form.categoryName" placeholder="请输入类目名称"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="排序" prop="treeSort">
              <a-input-number v-model="form.treeSort" :min="0" style="width: 100%"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="24" >
            <a-form-model-item label="类目状态" prop="status">
              <a-radio-group v-model="form.status">
                <a-radio
                  v-for="(dict, index) in statusOptions"
                  :key="index"
                  :value="dict.dictValue"
                >
                  {{ dict.dictLabel }}
                </a-radio>
              </a-radio-group>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-spin>
      <div class="bottom-control">
        <a-space>
          <a-button :disabled="disabled" @click="cancel">
            取消
          </a-button>
          <a-button type="primary" :disabled="disabled" @click="submitForm(true)">
            保存
          </a-button>
        </a-space>
      </div>
    </a-form-model>
  </a-drawer>
</template>
<script>
import BCategoryEditForm from './BCategoryForm'
export default {
  ...BCategoryEditForm
}
</script>
